//
//  ZSAccountsViewController.m
//  Timy
//
//  Created by zsj1992 on 16/12/12.
//  Copyright © 2016年 bjhj. All rights reserved.
//

#import "ZSAccountsViewController.h"
#import "ZSVerticalButton.h"
@interface ZSAccountsViewController ()<UICollectionViewDelegate,UICollectionViewDataSource>
@property (weak, nonatomic) IBOutlet UIView *titleView;
@property (weak, nonatomic) IBOutlet UICollectionView *collectionView;
@property (weak, nonatomic) IBOutlet UICollectionViewFlowLayout *collectionViewFlowlayout;
@property (weak, nonatomic) IBOutlet UIView *bottomView;

@end

@implementation ZSAccountsViewController


- (void)viewDidLoad {
    [super viewDidLoad];
    self.edgesForExtendedLayout = UIRectEdgeNone;
    self.automaticallyAdjustsScrollViewInsets = NO;

    [self setupCollectionView];
    [self setupUI];
    
    
}


-(void)setupCollectionView{
//[self.collectionView registerNib:<#(nullable UINib *)#> forCellWithReuseIdentifier:<#(nonnull NSString *)#>]
    
    
}

-(void)setupUI{

    UIImageView * imgView = [[UIImageView alloc]init];
    [self.titleView addSubview:imgView];
    imgView.layer.cornerRadius = 20;
    imgView.layer.masksToBounds = YES;
    imgView.layer.borderColor = [UIColor orangeColor].CGColor;
    imgView.layer.borderWidth = 1;
    
    imgView.image = [UIImage imageNamed:@"IMG_0852"];
    [imgView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.centerY.equalTo(self.titleView).offset(5);
        make.width.height.mas_equalTo(40);
        make.left.mas_equalTo(20);
    }];
    
    
    UIButton * btnLogin = [[UIButton alloc]init];
    [self.titleView addSubview:btnLogin];
    [btnLogin setTitleColor:[UIColor lightGrayColor] forState:(UIControlStateNormal)];
    [btnLogin setTitle:@"未登录" forState:(UIControlStateNormal)];
    btnLogin.titleLabel.font = [UIFont systemFontOfSize:13];
    [btnLogin mas_makeConstraints:^(MASConstraintMaker *make) {
        make.centerY.equalTo(imgView);
        make.left.equalTo(imgView.mas_right).offset(10);
    }];
    
    ZSVerticalButton * btnSetting = [[ZSVerticalButton alloc]init];
    [btnSetting setTitle:@"设置" forState:(UIControlStateNormal)];
    btnSetting.titleLabel.font = [UIFont systemFontOfSize:14];
    [btnSetting setImage:[UIImage imageNamed:@"menu_setting"] forState:(UIControlStateNormal)];
    [btnSetting setTitleColor:[UIColor lightGrayColor] forState:(UIControlStateNormal)];
    [self.titleView addSubview:btnSetting];
    [btnSetting mas_makeConstraints:^(MASConstraintMaker *make) {
        make.centerY.equalTo(imgView);
        make.right.equalTo(self.titleView).offset(-20);
        make.width.mas_equalTo(30);
        make.height.mas_equalTo(50);
    }];

    ZSVerticalButton * btnSync = [[ZSVerticalButton alloc]init];
    [btnSync setTitle:@"设置" forState:(UIControlStateNormal)];
    btnSync.titleLabel.font = [UIFont systemFontOfSize:14];
    [btnSync setImage:[UIImage imageNamed:@"synchronize_default"] forState:(UIControlStateNormal)];
    [btnSync setTitleColor:[UIColor lightGrayColor] forState:(UIControlStateNormal)];
    [self.titleView addSubview:btnSync];
    [btnSync mas_makeConstraints:^(MASConstraintMaker *make) {
        make.centerY.equalTo(imgView);
        make.right.equalTo(btnSetting.mas_left).offset(-20);
        make.width.mas_equalTo(30);
        make.height.mas_equalTo(50);
    }];
    

    ZSVerticalButton * btnRecommend= [[ZSVerticalButton alloc]init];
    [btnRecommend setTitle:@"探索" forState:(UIControlStateNormal)];
    btnRecommend.titleLabel.font = [UIFont systemFontOfSize:12];
    [btnRecommend setImage:[UIImage imageNamed:@"synchronize_default"] forState:(UIControlStateNormal)];
    [btnRecommend setTitleColor:[UIColor lightGrayColor] forState:(UIControlStateNormal)];
    [self.bottomView addSubview:btnRecommend];
    [btnRecommend mas_makeConstraints:^(MASConstraintMaker *make) {
        make.centerX.centerY.equalTo(self.bottomView);
        make.width.mas_equalTo(35);
        make.height.mas_equalTo(60);
    }];

}


-(NSInteger)collectionView:(UICollectionView *)collectionView numberOfItemsInSection:(NSInteger)section{

    return 1;
    
}


//-(UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath{
//
//    
//}




- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
